package model

import "go-caipu/pkg/services/dto"

type SysDept struct {
	DeptId   int64     `json:"deptId" gorm:"primaryKey;autoIncrement;"` //部门编码
	ParentId int64     `json:"parentId" gorm:""`                        //上级部门
	DeptPath string    `json:"deptPath" gorm:"size:255;"`               //
	DeptName string    `json:"deptName"  gorm:"size:128;"`              //部门名称
	Sort     int       `json:"sort" gorm:"size:4;"`                     //排序
	Leader   int       `json:"leader" gorm:"size:11;"`                  //负责人
	Phone    string    `json:"phone" gorm:"size:11;"`                   //手机
	Email    string    `json:"email" gorm:"size:64;"`                   //邮箱
	Status   int       `json:"status" gorm:"size:4;"`                   //状态
	Children []SysDept `json:"children" gorm:"-"`
	Remark   string    `gorm:"size:255;" json:"remark"` //描述
	dto.ControlBy
	dto.ModelTime

	CreateUser SysUserBaseInfo `gorm:"foreignKey:CreateBy;references:UserId"` //创建人
	UpdateUser SysUserBaseInfo `gorm:"foreignKey:UpdateBy;references:UserId"` //更新人
}

func (SysDept) TableName() string {
	return "sys_dept"
}
